package org.walklink.agent.track;

import java.util.Date;

/**
 * 链路span信息
 *
 * @author lidishan 2021/06/20
 */
public class TraceInfo {

    /** 链路唯一ID，可传递，这个后面设计，目前先做成当前线程唯一 **/
    private String traceId;
    /** 进入时间 **/
    private Date enterTime;
    /** 退出时间 **/
    private Date exitTime;
    /** 当前调用函数ID **/
    private String spanId;
    /** 上级spanId **/
    private String parentSpanId;


    public TraceInfo(){}

    public TraceInfo(String traceId){
        this.traceId = traceId;
        this.enterTime = new Date();
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public Date getEnterTime() {
        return enterTime;
    }

    public void setEnterTime(Date enterTime) {
        this.enterTime = enterTime;
    }

    public Date getExitTime() {
        return exitTime;
    }

    public void setExitTime(Date exitTime) {
        this.exitTime = exitTime;
    }

    public String getSpanId() {
        return spanId;
    }

    public void setSpanId(String spanId) {
        this.spanId = spanId;
    }

    public String getParentSpanId() {
        return parentSpanId;
    }

    public void setParentSpanId(String parentSpanId) {
        this.parentSpanId = parentSpanId;
    }
}
